package com.kaibes.admin.encryption;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.kaibes.core.spring.proxy.Proxy;
import com.kaibes.web.admin.AdminController;
import com.kaibes.web.api.ApiLink;
import com.kaibes.web.encryption.EncryptionKey;
import com.kaibes.web.encryption.EncryptionKeyService;

@AdminController
@RequestMapping("/admin/encryption")
public class EncryptionController {

    @Proxy
    private EncryptionKeyService encryptionClient;

    @GetMapping("setting")
    @ApiLink("加密模块设置")
    public String systemSet(Model model) {
    	EncryptionKey encryption = encryptionClient.getObject(EncryptionKey.class);
        model.addAttribute("encryption", encryption);
        return "encryption-setting";
    }

}
